#include <iostream>
using namespace std;

enum
{
    DIVZERO = 1,
    MODZERO,
    UNKOWN
};

string ops = "+-*/%";

class Task
{
public:
    Task(int x = 0, int y = 0, char op = '\0')
        : _x(x),
          _y(y),
          _op(op),
          _result(0),
          _exitcode(0)
    {
    }
    void run()
    {
        switch (_op)
        {
        case '+':
            _result = _x + _y;
            break;
        case '-':
            _result = _x - _y;
            break;
        case '*':
            _result = _x * _y;
            break;
        case '/':
        {
            if (_y == 0)
                _exitcode = DIVZERO;
            else
                _result = _x / _y;
        }
        break;
        case '%':
        {
            if (_y == 0)
                _exitcode = MODZERO;
            else
                _result = _x % _y;
        }
        break;
        default:
            _exitcode = UNKOWN;
            break;
        }
    }

    string getResult()
    {
        string res = to_string(_x);
        res += _op + to_string(_y) + "=" + to_string(_result);
        res += " [exitcode:" + to_string(_exitcode) + "]";
        return res;
    }

    string getTask()
    {
        string res = to_string(_x);
        res += _op + to_string(_y) + "=?";
        return res;
    }

    ~Task()
    {
    }

private:
    int _x;
    int _y;
    char _op;
    int _result;
    int _exitcode;
};